<template>
  <van-pull-refresh v-model="loading1" @refresh="onRefresh">
    <slot />
  </van-pull-refresh>
</template>

<script setup lang="ts">
import { defineEmits, computed } from 'vue';

const props = defineProps({
  loading: { type: Boolean, default: false },
});

const emit = defineEmits(['update:loading', 'load', 'refresh']);

const loading1 = computed({
  get: () => props.loading,
  set: (val) => emit('update:loading', val),
});

const onRefresh = () => emit('refresh');
</script>

<style lang="scss" scoped>
.no-data {
  text-align: center;
  line-height: 100px;
  font-size: 14px;
}
</style>
